package com.example.service;

import com.example.aspect.InvokeLog;
import com.example.entity.Phone;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Service;

/**
 * @Auther: tong
 * @Date: 2023/01/18/23:29
 * @Description:
 */
@Service
public class PhoneService {
    @InvokeLog
    public void addPhone(Phone phone) {
        System.out.println("新增手机");
    }

    @InvokeLog
    public void updatePhone(Phone phone) {
        System.out.println("修改手机");
    }

    @InvokeLog
    public void deletePhone(String number) {
        System.out.println("删除手机");
    }

    @InvokeLog
    public Phone getPhoneByNumber(String number) {
        System.out.println("查询手机");
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        return context.getBean(Phone.class);
    }

    @InvokeLog
    public void testPhone(){
        System.out.println("测试手机");
    }
}
